{% extends 'base.html' %}

{% block title %}登录{% endblock %}

{% block content %}
    <div class="login-form">
        <form action="{% url 'account:login' %}" method="post">
{#            {{ form.as_p }}#}
            {% for field in form %}
                {{ field.label_tag }}
                {{ field }}
                {{ field.errors }}
            {% endfor %}
            {% csrf_token %}
            <input type="hidden" name="next" value="{{ next }}">
            <p><input type="submit" value="登录"></p>
            <div class="forget_password">
                <a href="{% url 'account:password_reset' %}">忘记密码</a>
            </div>
            <div class="register">
                <a href="{% url 'account:register' %}">注册</a>
            </div>
        <div class="error-message">
            {% if form.errors %}
                用户名密码不正确，请重新输入！
            {% endif %}
        </div>
        </form>
    </div>
{% endblock %}